package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.entity.JcAjztTjRyEntity;
import cn.com.css.taxInspection.gt3.mapper.JcAjztTjRyMapper;
import cn.com.css.taxInspection.gt3.service.JcAjztTjRyService;
import cn.com.css.taxInspection.util.TsBqUtils;

@Service("jcAjztTjRyService")
public class JcAjztTjRyServiceImpl extends ServiceImpl<JcAjztTjRyMapper, JcAjztTjRyEntity> implements JcAjztTjRyService {

    @Override
    public IPage<JcAjztTjRyEntity> infoPage(JcAjztTjRyEntity jcAjztTjRyEntity) {
        Page<JcAjztTjRyEntity> page = new Page<>(0, 10000);
        LambdaQueryWrapper<JcAjztTjRyEntity> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(JcAjztTjRyEntity::getSwjgDm, jcAjztTjRyEntity.getSwjgDm());
        queryWrapper.eq(JcAjztTjRyEntity::getNd, jcAjztTjRyEntity.getNd());
        String swryDm = jcAjztTjRyEntity.getSwryDm();
        if (TsBqUtils.isNotNull(swryDm)) {
            queryWrapper.eq(JcAjztTjRyEntity::getSwryDm, swryDm);
        }
        return this.page(page, queryWrapper);
    }

}